package com.yang.utils;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class ResponseUtils {
    /**组装返回参数*/
    public static void response(HttpServletResponse httpResponse, String result) throws IOException {
        httpResponse.setHeader("Pragma", "no-cache");
        httpResponse.setCharacterEncoding("utf-8");
        httpResponse.setContentType("application/json;charset=UTF-8");
        PrintWriter out = httpResponse.getWriter();
        out.print(result);
        out.flush();
        out.close();
    }
}
